<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body><?php
include_once '../Login/databaseconnection.php';

if(!loggedin())
{
	require_once '../index.php';
}
   
   else
   {

	$T_NIC_Number=$_POST['T_NIC_Number'];
  $School_Id=$_POST['School_Id'];
  $First_Name=$_POST['First_Name'];
  $Last_Name=$_POST['Last_Name'];
  $Date_Of_Birth=$_POST['Date_Of_Birth'];
  $Gender=$_POST['Gender'];
  $Nature_Of_Appointment=$_POST['Nature_Of_Appointment'];
  $Service=$_POST['Service'];
  $Acadamic_Qualifications=$_POST['Acadamic_Qualifications'];
  $Professional_Qualifications=$_POST['Professional_Qualifications'];
  $Achievements=$_POST['Achievements&Awards'];
  $Address=$_POST['Address'];
  $Mobile_Tp_Number=$_POST['Mobile_Tp_Number'];
  $Home_Tp_Number=$_POST['Home_Tp_Number'];
  $Office_Tp_Number=$_POST['Office_Tp_Number'];
  $Appointment_Date=$_POST['Appointment_Date'];
  $Appointed_Subject=$_POST['Appointed_Subject'];
   
	
	if($T_NIC_Number==" " || $School_Id==" " || $First_Name==" " || $Last_Name==" " || $Date_Of_Birth==" " || $Gender==" " || $Nature_Of_Appointment==" " || $Service==" " || $Acadamic_Qualifications==" " || $Professional_Qualifications==" " || $Achievements==" " || $Address==" " || $Mobile_Tp_Number==" "||$Home_Tp_Number==" " || $Office_Tp_Number==" " || $Appointment_Date==" " || $Appointed_Subject==" ")
	{
		   $_SESSION['errorin']="Not enough inputs!";
	 
	}
	else
	{
$sql=mysql_query("UPDATE teacher SET 
T_NIC_Number='$T_NIC_Number',School_Id='$School_Id',First_Name='$First_Name',Last_Name='$Last_Name',Date_Of_Birth='$Date_Of_Birth',Gender='$Gender',Nature_Of_Appointment='$Nature_Of_Appointment',Service='$Service',Acadamic_Qualifications='$Acadamic_Qualifications',Professional_Qualifications='$Professional_Qualifications',Achievements&Awards='$Achievements',Address='$Address',Mobile_Tp_Number='$Mobile_Tp_Number',Home_Tp_Number='$Home_Tp_Number',Office_Tp_Number='$Office_Tp_Number',Appointment_Date='$Appointment_Date',Appointed_Subject='$Appointed_Subject'");
if($sql)
  {
$_SESSION['error']="Your record is successfully updated!";
 //require_once 'Programmes.php';
  }

  if(!$sql)
  {
 $_SESSION['error']="Sorry unable to update your record!";
  //require_once 'UpdateProSch.php';

  }
	
}
}
  ?>
</body>
</html>
